\chapter{Calculation of Layer Height and the Average Upper and Lower Layer Temperatures}
\label{Appendix_layerheight}

Fire protection engineers often need to estimate the location of the interface between the hot, smoke-laden upper layer and the cooler lower layer in a burning compartment. Zone fire models such as CFAST compute this quantity directly, along with the average temperature of the upper and lower layers.  In an experimental test or a computational fluid dynamics (CFD) model like FDS \cite{FDS_Tech_Guide_6}, there are not two distinct zones, but rather a continuous profile of temperature. Nevertheless, methods have been developed to estimate layer height and average temperatures from a continuous vertical profile of temperature. One such method~\cite{Janssens:1992} is as follows: Consider a continuous function $T(z)$ defining temperature $T$ as a function of height above the floor $z$, where $z=0$ is the floor and $z=H$ is the ceiling. Define $T_u$ as the upper layer temperature, $T_l$ as the
lower layer temperature, and $z_{int}$ as the interface height. Compute the quantities:

\be (H-z_{int})\; T_u + z_{int} \; T_l = \int_0^H \; T(z) \; dz = I_1 \ee
\be (H-z_{int})\; \frac{1}{T_u} + z_{int} \; \frac{1}{T_l} = \int_0^H \; \frac{1}{T(z)} \; dz = I_2 \ee

Solve for $z_{int}$:

\be z_{int} = \frac{ T_l(I_1 \, I_2 - H^2)}{I_1+I_2 \, T_l^2 - 2\, T_l \, H} \ee

Let $T_l$ be the temperature in the lowest mesh cell or lowest measurement point and, using Simpson's Rule, perform the numerical integration of $I_1$ and $I_2$. $T_u$ is defined as the average upper layer temperature via

\be (H-z_{int})\; T_u = \int_{z_{int}}^H \; T(z) \; dz \ee

For experimental test data or CFD model output, the integral function of temperature as a function of height can be estimated empirically from a number of discrete data points. Further discussion of similar procedures can be found in Ref.~\cite{He:1998}.

\clearpage 